import React from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
import {fromJS, is} from 'immutable';


import {shouldUpdate} from './util/component-updater'

export default class ChirdB4 extends React.PureComponent {


  shouldComponentUpdate(nextProps) {
    // return !is(fromJS(nextProps.count.count), fromJS(this.props.count.count+1));
    // return !is(fromJS(nextProps.count), fromJS(this.props.count));
    // return shouldUpdate(this.props, nextProps, ['count']);
    return nextProps.count === this.props.count;//此处有坑，比较的是对象的内存地址
  }

  render() {
    console.log('ChirdB4 render', this.props.count);

    return (
      <View style={{backgroundColor: 'yellow'}}>
        <Text>三级页面</Text>
        <Text>ChirdB4</Text>
      </View>
    )
  }
}
